Integrand size = 18, antiderivative size = 94 \[ \int (c+d x) \cos (a+b x) \cot (a+b x) \, dx=-\frac {2 (c+d x) \text {arctanh}\left (e^{i (a+b x)}\right )}{b}+\frac {(c+d x) \cos (a+b x)}{b}+\frac {i d \operatorname {PolyLog}\left (2,-e^{i (a+b x)}\right )}{b^2}-\frac {i d \operatorname {PolyLog}\left (2,e^{i (a+b x)}\right )}{b^2}-\frac {d \sin (a+b x)}{b^2} \]
[Out]
Time = 0.08 (sec) , antiderivative size = 94, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {4493, 3377, 2717, 4268, 2317, 2438} \[ \int (c+d x) \cos (a+b x) \cot (a+b x) \, dx=-\frac {2 (c+d x) \text {arctanh}\left (e^{i (a+b x)}\right )}{b}+\frac {i d \operatorname {PolyLog}\left (2,-e^{i (a+b x)}\right )}{b^2}-\frac {i d \operatorname {PolyLog}\left (2,e^{i (a+b x)}\right )}{b^2}-\frac {d \sin (a+b x)}{b^2}+\frac {(c+d x) \cos (a+b x)}{b} \]
[In]
[Out]
Rule 2317
Rule 2438
Rule 2717
Rule 3377
Rule 4268
Rule 4493
Rubi steps \begin{align*} \text {integral}& = \int (c+d x) \csc (a+b x) \, dx-\int (c+d x) \sin (a+b x) \, dx \\ & = -\frac {2 (c+d x) \text {arctanh}\left (e^{i (a+b x)}\right )}{b}+\frac {(c+d x) \cos (a+b x)}{b}-\frac {d \int \cos (a+b x) \, dx}{b}-\frac {d \int \log \left (1-e^{i (a+b x)}\right ) \, dx}{b}+\frac {d \int \log \left (1+e^{i (a+b x)}\right ) \, dx}{b} \\ & = -\frac {2 (c+d x) \text {arctanh}\left (e^{i (a+b x)}\right )}{b}+\frac {(c+d x) \cos (a+b x)}{b}-\frac {d \sin (a+b x)}{b^2}+\frac {(i d) \text {Subst}\left (\int \frac {\log (1-x)}{x} \, dx,x,e^{i (a+b x)}\right )}{b^2}-\frac {(i d) \text {Subst}\left (\int \frac {\log (1+x)}{x} \, dx,x,e^{i (a+b x)}\right )}{b^2} \\ & = -\frac {2 (c+d x) \text {arctanh}\left (e^{i (a+b x)}\right )}{b}+\frac {(c+d x) \cos (a+b x)}{b}+\frac {i d \operatorname {PolyLog}\left (2,-e^{i (a+b x)}\right )}{b^2}-\frac {i d \operatorname {PolyLog}\left (2,e^{i (a+b x)}\right )}{b^2}-\frac {d \sin (a+b x)}{b^2} \\ \end{align*}
Time = 0.32 (sec) , antiderivative size = 176, normalized size of antiderivative = 1.87 \[ \int (c+d x) \cos (a+b x) \cot (a+b x) \, dx=\frac {c \cos (a+b x)}{b}-\frac {c \log \left (\cos \left (\frac {1}{2} (a+b x)\right )\right )}{b}+\frac {c \log \left (\sin \left (\frac {1}{2} (a+b x)\right )\right )}{b}+\frac {d \left ((a+b x) \left (\log \left (1-e^{i (a+b x)}\right )-\log \left (1+e^{i (a+b x)}\right )\right )-a \log \left (\tan \left (\frac {1}{2} (a+b x)\right )\right )+i \left (\operatorname {PolyLog}\left (2,-e^{i (a+b x)}\right )-\operatorname {PolyLog}\left (2,e^{i (a+b x)}\right )\right )\right )}{b^2}+\frac {d \cos (b x) (b x \cos (a)-\sin (a))}{b^2}-\frac {d (\cos (a)+b x \sin (a)) \sin (b x)}{b^2} \]
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 176 vs. \(2 (86 ) = 172\).
Time = 1.17 (sec) , antiderivative size = 177, normalized size of antiderivative = 1.88
method | result | size |
default | \(\frac {-\frac {d a \cos \left (x b +a \right )}{b}+c \cos \left (x b +a \right )-\frac {d \left (\sin \left (x b +a \right )-\left (x b +a \right ) \cos \left (x b +a \right )\right )}{b}}{b}+\frac {-\frac {d a \ln \left (\csc \left (x b +a \right )-\cot \left (x b +a \right )\right )}{b}+c \ln \left (\csc \left (x b +a \right )-\cot \left (x b +a \right )\right )+\frac {d \left (\left (x b +a \right ) \ln \left (1-{\mathrm e}^{i \left (x b +a \right )}\right )-\left (x b +a \right ) \ln \left ({\mathrm e}^{i \left (x b +a \right )}+1\right )+i \operatorname {dilog}\left ({\mathrm e}^{i \left (x b +a \right )}+1\right )-i \operatorname {dilog}\left (1-{\mathrm e}^{i \left (x b +a \right )}\right )\right )}{b}}{b}\) | \(177\) |
risch | \(\frac {\left (d x b +c b +i d \right ) {\mathrm e}^{i \left (x b +a \right )}}{2 b^{2}}+\frac {\left (d x b +c b -i d \right ) {\mathrm e}^{-i \left (x b +a \right )}}{2 b^{2}}-\frac {2 c \,\operatorname {arctanh}\left ({\mathrm e}^{i \left (x b +a \right )}\right )}{b}+\frac {d \ln \left (1-{\mathrm e}^{i \left (x b +a \right )}\right ) x}{b}+\frac {d \ln \left (1-{\mathrm e}^{i \left (x b +a \right )}\right ) a}{b^{2}}-\frac {i d \operatorname {polylog}\left (2, {\mathrm e}^{i \left (x b +a \right )}\right )}{b^{2}}-\frac {d \ln \left ({\mathrm e}^{i \left (x b +a \right )}+1\right ) x}{b}-\frac {d \ln \left ({\mathrm e}^{i \left (x b +a \right )}+1\right ) a}{b^{2}}+\frac {i d \operatorname {polylog}\left (2, -{\mathrm e}^{i \left (x b +a \right )}\right )}{b^{2}}+\frac {2 d a \,\operatorname {arctanh}\left ({\mathrm e}^{i \left (x b +a \right )}\right )}{b^{2}}\) | \(203\) |
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 277 vs. \(2 (82) = 164\).
Time = 0.27 (sec) , antiderivative size = 277, normalized size of antiderivative = 2.95 \[ \int (c+d x) \cos (a+b x) \cot (a+b x) \, dx=\frac {2 \, {\left (b d x + b c\right )} \cos \left (b x + a\right ) - i \, d {\rm Li}_2\left (\cos \left (b x + a\right ) + i \, \sin \left (b x + a\right )\right ) + i \, d {\rm Li}_2\left (\cos \left (b x + a\right ) - i \, \sin \left (b x + a\right )\right ) - i \, d {\rm Li}_2\left (-\cos \left (b x + a\right ) + i \, \sin \left (b x + a\right )\right ) + i \, d {\rm Li}_2\left (-\cos \left (b x + a\right ) - i \, \sin \left (b x + a\right )\right ) - {\left (b d x + b c\right )} \log \left (\cos \left (b x + a\right ) + i \, \sin \left (b x + a\right ) + 1\right ) - {\left (b d x + b c\right )} \log \left (\cos \left (b x + a\right ) - i \, \sin \left (b x + a\right ) + 1\right ) + {\left (b c - a d\right )} \log \left (-\frac {1}{2} \, \cos \left (b x + a\right ) + \frac {1}{2} i \, \sin \left (b x + a\right ) + \frac {1}{2}\right ) + {\left (b c - a d\right )} \log \left (-\frac {1}{2} \, \cos \left (b x + a\right ) - \frac {1}{2} i \, \sin \left (b x + a\right ) + \frac {1}{2}\right ) + {\left (b d x + a d\right )} \log \left (-\cos \left (b x + a\right ) + i \, \sin \left (b x + a\right ) + 1\right ) + {\left (b d x + a d\right )} \log \left (-\cos \left (b x + a\right ) - i \, \sin \left (b x + a\right ) + 1\right ) - 2 \, d \sin \left (b x + a\right )}{2 \, b^{2}} \]
[In]
[Out]
\[ \int (c+d x) \cos (a+b x) \cot (a+b x) \, dx=\int \left (c + d x\right ) \cos {\left (a + b x \right )} \cot {\left (a + b x \right )}\, dx \]
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 200 vs. \(2 (82) = 164\).
Time = 0.33 (sec) , antiderivative size = 200, normalized size of antiderivative = 2.13 \[ \int (c+d x) \cos (a+b x) \cot (a+b x) \, dx=-\frac {2 i \, b d x \arctan \left (\sin \left (b x + a\right ), -\cos \left (b x + a\right ) + 1\right ) - 2 i \, b c \arctan \left (\sin \left (b x + a\right ), \cos \left (b x + a\right ) - 1\right ) - 2 \, {\left (-i \, b d x - i \, b c\right )} \arctan \left (\sin \left (b x + a\right ), \cos \left (b x + a\right ) + 1\right ) - 2 \, {\left (b d x + b c\right )} \cos \left (b x + a\right ) - 2 i \, d {\rm Li}_2\left (-e^{\left (i \, b x + i \, a\right )}\right ) + 2 i \, d {\rm Li}_2\left (e^{\left (i \, b x + i \, a\right )}\right ) + {\left (b d x + b c\right )} \log \left (\cos \left (b x + a\right )^{2} + \sin \left (b x + a\right )^{2} + 2 \, \cos \left (b x + a\right ) + 1\right ) - {\left (b d x + b c\right )} \log \left (\cos \left (b x + a\right )^{2} + \sin \left (b x + a\right )^{2} - 2 \, \cos \left (b x + a\right ) + 1\right ) + 2 \, d \sin \left (b x + a\right )}{2 \, b^{2}} \]
[In]
[Out]
\[ \int (c+d x) \cos (a+b x) \cot (a+b x) \, dx=\int { {\left (d x + c\right )} \cos \left (b x + a\right ) \cot \left (b x + a\right ) \,d x } \]
[In]
[Out]
Timed out. \[ \int (c+d x) \cos (a+b x) \cot (a+b x) \, dx=\int \cos \left (a+b\,x\right )\,\mathrm {cot}\left (a+b\,x\right )\,\left (c+d\,x\right ) \,d x \]
[In]
[Out]